Skip to content

Conversation

@pazeshun
Copy link
Contributor

@pazeshun pazeshun commented Aug 7, 2025

Updated version of #544

Depends on ros/rosdistro#47247
(I am still in the middle of studying ROS-O, so I am not sure this PR is enough for ROS-O release. I will keep studying.)

This PR adds power_switching_tools_ros, ROS tools for power switching tools (e.g., USB-Serial troubleshooter, VirtualHere USB 3 4-Port Hub).

@pazeshun pazeshun mentioned this pull request Aug 7, 2025
Copy link
Member

@mqcmd196 mqcmd196 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pazeshun Could you rebase current origin/master to update travis?

@pazeshun pazeshun force-pushed the power_switching_tools_ros branch from d3d13c2 to 2a9c57a Compare August 7, 2025 06:56
@pazeshun
Copy link
Contributor Author

pazeshun commented Aug 7, 2025

@pazeshun Could you rebase current origin/master to update travis?

Sorry, at this moment, I want to minimize the difference from #544 and make understanding that difference easy because #544 is already used by multiple users.
I'll merge origin/master when we are ready.

@pazeshun pazeshun force-pushed the power_switching_tools_ros branch from 2a9c57a to 29ec7ba Compare August 7, 2025 07:26
@sawada10
Copy link
Contributor

sawada10 commented Aug 9, 2025

@pazeshun
Thank you and I tried using USB PPPS hubs.

  • Laptop: Worked without any issues.
  • Raspberry Pi 4 (on Kashiwagi-san’s setup):
    • USB 2.0 port: Works as expected.
    • USB 3.0 port: Shows success as following but the power doesn’t seem to actually turn off.
      I had a m5stickC connected, and based on its behavior, it appeared that the power was not turned off.
$ rosservice call /usb_ppps_hub_driver/power "data: false" 
success: True
message: ''

(Not a critical issue for now, as using the USB 2.0 port works fine.)

@pazeshun
Copy link
Contributor Author

pazeshun commented Aug 9, 2025

@sawada10
Thank you for reporting.
When you connected your hub to USB 3.0 port and typed uhubctl, you got two virtual hubs and selected only one hub, didn't you?
I want to try powering off both hubs.
Could you try the following commands, check if the power is turned off, and report the output of each command just after you reboot Raspberry Pi 4?

uhubctl
uhubctl -a 0 -l <hub_location you previously selected> -p <hub_port you selected previously>
uhubctl -a 0 -l <hub_location you previously did not select> -p <the same hub_port as above>

@sawada10
Copy link
Contributor

sawada10 commented Aug 9, 2025

@pazeshun
Thank you for your response.
After I rebooted the Raspberry Pi 4, I tried following command, but the power is still on.

ubuntu@unnatural-mangrove:~$ uhubctl
Current status for hub 2-1 [366b:0005 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 3.20, 4 ports]
  Port 1: 06a0 power Rx.Detect
  Port 2: 06a0 power Rx.Detect
  Port 3: 06a0 power Rx.Detect
  Port 4: 06a0 power Rx.Detect
Current status for hub 2 [1d6b:0003 Linux 5.4.0-1129-raspi xhci-hcd xHCI Host Controller 0000:01:00.0, USB 3.00, 4 ports]
  Port 1: 0263 power 5gbps U3 enable connect [366b:0005 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 3.20, 4 ports]
  Port 2: 02a0 power 5gbps Rx.Detect
  Port 3: 02a0 power 5gbps Rx.Detect
  Port 4: 02a0 power 5gbps Rx.Detect
Current status for hub 1-1.1 [366b:0004 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 2.10, 4 ports]
  Port 1: 0100 power
  Port 2: 0100 power
  Port 3: 0100 power
  Port 4: 0103 power enable connect [0403:6001 Kongou Hikari M5Stack Intf 595240C845]
Current status for hub 1 [1d6b:0002 Linux 5.4.0-1129-raspi xhci-hcd xHCI Host Controller 0000:01:00.0]
  Port 1: 0503 power highspeed enable connect [2109:3431 USB2.0 Hub, USB 2.10, 4 ports]

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 1-1.1 -p 4
Current status for hub 1-1.1 [366b:0004 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 2.10, 4 ports]
  Port 4: 0103 power enable connect [0403:6001 Kongou Hikari M5Stack Intf 595240C845]
Sent power off request
New status for hub 1-1.1 [366b:0004 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 2.10, 4 ports]
  Port 4: 0000 off

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 2-1 -p 4
No compatible smart hubs detected at location 2-1!
Run with -h to get usage info.
There were permission problems while accessing USB.
To fix this, run this tool as root using 'sudo uhubctl',
or add one or more udev rules like below
to file '/etc/udev/rules.d/52-usb.rules':
SUBSYSTEM=="usb", ATTR{idVendor}=="2001", MODE="0666"
then run 'sudo udevadm trigger --attr-match=subsystem=usb'

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 2 -p 4
No compatible smart hubs detected at location 2!
Run with -h to get usage info.
There were permission problems while accessing USB.
To fix this, run this tool as root using 'sudo uhubctl',
or add one or more udev rules like below
to file '/etc/udev/rules.d/52-usb.rules':
SUBSYSTEM=="usb", ATTR{idVendor}=="2001", MODE="0666"
then run 'sudo udevadm trigger --attr-match=subsystem=usb'

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 1 -p 4
Current status for hub 1 [1d6b:0002 Linux 5.4.0-1129-raspi xhci-hcd xHCI Host Controller 0000:01:00.0]
Sent power off request
New status for hub 1 [1d6b:0002 Linux 5.4.0-1129-raspi xhci-hcd xHCI Host Controller 0000:01:00.0]

@pazeshun
Copy link
Contributor Author

pazeshun commented Aug 9, 2025

@sawada10
Thank you for your report.
Could you check the following commands, check if the power is turned off, and report the output?

uhubctl -a 0 -l 1-1.1
uhubctl -a 0 -l 2-1

@sawada10
Copy link
Contributor

sawada10 commented Aug 9, 2025

@pazeshun
Thank you for your response.
I tried the followings, but the power is still on.

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 1-1.1
Current status for hub 1-1.1 [366b:0004 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 2.10, 4 ports]
  Port 1: 0100 power
  Port 2: 0100 power
  Port 3: 0100 power
  Port 4: 0000 off
Sent power off request
New status for hub 1-1.1 [366b:0004 VirtualHere Pty. Ltd. VirtualHere 4-Port Hub 91B35D672F3E3755, USB 2.10, 4 ports]
  Port 1: 0000 off
  Port 2: 0000 off
  Port 3: 0000 off
  Port 4: 0000 off

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 2-1
No compatible smart hubs detected at location 2-1!
Run with -h to get usage info.
There were permission problems while accessing USB.
To fix this, run this tool as root using 'sudo uhubctl',
or add one or more udev rules like below
to file '/etc/udev/rules.d/52-usb.rules':
SUBSYSTEM=="usb", ATTR{idVendor}=="2001", MODE="0666"
then run 'sudo udevadm trigger --attr-match=subsystem=usb'

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 2
No compatible smart hubs detected at location 2!
Run with -h to get usage info.
There were permission problems while accessing USB.
To fix this, run this tool as root using 'sudo uhubctl',
or add one or more udev rules like below
to file '/etc/udev/rules.d/52-usb.rules':
SUBSYSTEM=="usb", ATTR{idVendor}=="2001", MODE="0666"
then run 'sudo udevadm trigger --attr-match=subsystem=usb'

ubuntu@unnatural-mangrove:~$ uhubctl -a 0 -l 1
Current status for hub 1 [1d6b:0002 Linux 5.4.0-1129-raspi xhci-hcd xHCI Host Controller 0000:01:00.0]
  Port 1: 0503 power highspeed enable connect [2109:3431 USB2.0 Hub, USB 2.10, 4 ports]
Sent power off request
New status for hub 1 [1d6b:0002 Linux 5.4.0-1129-raspi xhci-hcd xHCI Host Controller 0000:01:00.0]
  Port 1: 0000 off

@pazeshun pazeshun force-pushed the power_switching_tools_ros branch from c9d1668 to 855d58d Compare August 13, 2025 03:41
@sawada10
Copy link
Contributor

sawada10 commented Sep 17, 2025

I debugged with @pazeshun.
There were two following problems.

  • how to check the power on/off

    • [Problem] I checked whether the power was on/off with M5StickC's monitor. However, M5StickC has battery inside and its monitor was sometimes still powered on even if the power was actually off.
    • [Solution] It was better to use a different way to check the power, such as this usb-serial adapter.
  • uhubctl command from source

    • [Problem] We checked with the usb-serial adapter above, but following problem still existed.
    • USB 3.0 port: Shows success as following but the power doesn’t seem to actually turn off.

    • [Solution] We could change power on/off with uhubctl command from source (→https://github.com/mvp/uhubctl.git) instead of the command from apt.

@pazeshun
Copy link
Contributor Author

@sawada10 Thank you very much.
We added how to use source version of uhubctl to README (e8ef3a5), so problem reported by @sawada10 is now solved.

@pazeshun pazeshun force-pushed the power_switching_tools_ros branch from 397a3ed to 6eb6081 Compare October 17, 2025 17:57
@pazeshun pazeshun force-pushed the power_switching_tools_ros branch from 6eb6081 to 0e13655 Compare October 17, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants